package com.insigma.business.qrcode.job.controller;

import com.insigma.business.qrcode.common.template.BasePagingResponse;
import com.insigma.business.qrcode.common.vo.BaseResponse;
import com.insigma.business.qrcode.job._bff.TrainBFFProvider;
import com.insigma.business.qrcode.job._bff.TrainingMentorBFFProvider;
import com.insigma.business.qrcode.job.dto.TrainingMentorDTO;
import com.insigma.business.qrcode.job.dto.TrainingVideoDTO;
import com.insigma.business.qrcode.job.dto.request.TrainingMentorSearchRequest;
import com.insigma.business.qrcode.job.dto.request.TrainingVideoSearchRequest;
import com.insigma.business.qrcode.soldier.request.BaseGetRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api("培训信息")
@RestController
@RequestMapping("/training")
public class TrainingController {

    @Resource
    private TrainBFFProvider trainBFFProvider;

    @Resource
    private TrainingMentorBFFProvider trainingMentorBFFProvider;


    @ApiOperation("教育培训信息列表")
    @PostMapping("/searchTrainingVideo")
    public BasePagingResponse<List<TrainingVideoDTO>> searchTrainingVideo(@RequestBody TrainingVideoSearchRequest searchRequest){
        return trainBFFProvider.searchTrainingVideo(searchRequest);
    }

    @ApiOperation("教育培训信息详情")
    @PostMapping("/getTrainingVideo")
    public BaseResponse<TrainingVideoDTO> getTrainingVideo(@RequestBody BaseGetRequest searchRequest){
        return trainBFFProvider.getTrainingVideo(searchRequest);
    }

    @ApiOperation("就业导师列表")
    @PostMapping("/searchTrainingMentor")
    public BasePagingResponse<List<TrainingMentorDTO>> searchTrainingMentor(@RequestBody TrainingMentorSearchRequest searchRequest){
        return trainingMentorBFFProvider.searchTrainingMentor(searchRequest);
    }

    @ApiOperation("就业导师详情")
    @PostMapping("/getTrainingMentor")
    public BaseResponse<TrainingMentorDTO> getTrainingMentor(@RequestBody BaseGetRequest baseGetRequest){
        return trainingMentorBFFProvider.getTrainingMentor(baseGetRequest);
    }

}
